package net.sky.oa.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *请假申请
 *FloLeave. @author hond
 */
@Entity
@Table(name = "FLO_LEAVE")//请假申请
public class FloLeave implements Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id ;	
	private Integer type;       //请假类型
	private Date begintime;    //开始时间
	private Date endtime;    //结束时间
	private String reason;   //请假原因
	private Integer issubmit;//是否提交：1是2否
	private Integer status;     //状态
	private SysEmployee user;  //用户id
	private SysDept dept;    //部门id

	// Constructors

	/** default constructor */
	public FloLeave() {
	}

	/** minimal constructor */
	public FloLeave(Long id) {
		this.id = id;
	}
	
	@Id
	@SequenceGenerator(name="SQ_FLOLEAVE_ID",sequenceName="SQ_FLOLEAVE_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_FLOLEAVE_ID")
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	
	@Column(name = "TYPE", precision = 2, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "BEGINTIME", length = 7)
	public Date getBegintime() {
		return this.begintime;
	}

	public void setBegintime(Date begintime) {
		this.begintime = begintime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ENDTIME", length = 7)
	public Date getEndtime() {
		return this.endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}

	@Column(name = "REASON", length = 200)
	public String getReason() {
		return this.reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	@Column(name = "ISSUBMIT", precision = 1, scale = 0)
	public Integer getIssubmit() {
		return this.issubmit;
	}

	public void setIssubmit(Integer issubmit) {
		this.issubmit = issubmit;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DEPT_ID")
	public SysDept getDept() {
		return this.dept;
	}

	public void setDept(SysDept dept) {
		this.dept = dept;
	}
	
	

}